<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>充值</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
    金额：<input type="text" name="amount" value="" placeholder="请输入金额"><br/>
    <input type="radio" name="pay_type" value="1" >支付宝
    <input type="radio" name="pay_type" value="2">微信
    <input type="hidden" name="order_sn" value="{$order_sn}"><br/>
    <input type="text" name="uid" value="{$member.uid}"><br/>
    <input type="button" value="充值" onclick="zhifu();">
</body>
</html>
<script>
    /**
     * 充值
     */
    function zhifu(){
        var order_sn = $('input[name=order_sn]').val();
        var pay_type = $('input[name=pay_type]:checked').val();
        var amount = $('input[name=amount]').val();
        var uid = $('input[name=uid]').val();
        window.location.href = "{:url('Weixinpay/recharge_code')}?order_sn="+order_sn+"&pay_type="+pay_type+"&amount="+amount+"&uid="+uid;
//        $.post("{:url('Weixinpay/recharge')}",
//            {order_sn:order_sn,pay_type:pay_type,amount:amount,uid:uid},
//            function(data){
//                if(data.code == 1){
////                    alert('充值成功');
//                }else{
////                    alert('充值失败');
//                }
//            }
//
//        );


    }
</script>